
import java.util.Scanner;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class Game {
    public static void main(String[] args) {
        //通过Random类中的nextInt（int n）方法，生成1-3的随机数 1代表剪刀 2代表
        //石头 3代表布
        int computer=0,person=0;
        int a = 0;   //玩家获胜场次
        int b = 0;   //平局场次
        int d =0;  //玩家输的场次
        ToneScissorClothImpl game =new ToneScissorClothImpl();
        log.info("程序已启动");
        log.info("1剪刀  2石头  3布");

         Scanner nu =new Scanner(System.in);
               log.info("请输入你想要进行的对局数：");
               int num =nu.nextInt();
        for (int i = 1; i <= num; i++) {
            log.info("第" + i + "局");

            switch ( game.gamestander(person,computer))
            {
                case 0:b++;
                       break;
                case 1:a++;
                       break;
                case 2: d++;
                 break;
                case -1:
                default:       i-=1;
                              break;
            }
        }
        log.info("本次游戏您赢了" + a + "局,平了" + b + "局");
        int c = 5 - a - b;    //计算出电脑胜利的场次
        if (a == c) {
            log.info("和局！");
        } else if (a > b) {
            log.info("您赢了！");
        } else {
            log.info("您输了！");
        }
    }
}